.class public Lorg/zeam/PagingView;
.super Landroid/widget/HorizontalScrollView;
.source "PagingView.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lorg/zeam/PagingView$OnPageScrollListener;,
        Lorg/zeam/PagingView$PageViewGestureDetector;
    }
.end annotation


# static fields
.field private static final sSwipeMinDistance:I = 0x5

.field private static final sSwipeThresholdVelocity:I = 0x1f4


# instance fields
.field private mCurrentMotionEvent:Landroid/view/MotionEvent;

.field private mCurrentPageIndex:I

.field private mGestureDetector:Landroid/view/GestureDetector;

.field private mOnPageScrollListener:Lorg/zeam/PagingView$OnPageScrollListener;

.field private mPageViewHolder:Landroid/widget/LinearLayout;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter "context"

    .prologue
    .line 35
    invoke-direct {p0, p1}, Landroid/widget/HorizontalScrollView;-><init>(Landroid/content/Context;)V

    .line 20
    const/4 v0, 0x0

    iput v0, p0, Lorg/zeam/PagingView;->mCurrentPageIndex:I

    .line 36
    invoke-direct {p0}, Lorg/zeam/PagingView;->init()V

    .line 37
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 30
    invoke-direct {p0, p1, p2}, Landroid/widget/HorizontalScrollView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 20
    const/4 v0, 0x0

    iput v0, p0, Lorg/zeam/PagingView;->mCurrentPageIndex:I

    .line 31
    invoke-direct {p0}, Lorg/zeam/PagingView;->init()V

    .line 32
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 1
    .parameter "context"
    .parameter "attrs"
    .parameter "defStyle"

    .prologue
    .line 25
    invoke-direct {p0, p1, p2, p3}, Landroid/widget/HorizontalScrollView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 20
    const/4 v0, 0x0

    iput v0, p0, Lorg/zeam/PagingView;->mCurrentPageIndex:I

    .line 26
    invoke-direct {p0}, Lorg/zeam/PagingView;->init()V

    .line 27
    return-void
.end method

.method static synthetic access$0(Lorg/zeam/PagingView;)Landroid/view/MotionEvent;
    .locals 1
    .parameter

    .prologue
    .line 89
    iget-object v0, p0, Lorg/zeam/PagingView;->mCurrentMotionEvent:Landroid/view/MotionEvent;

    return-object v0
.end method

.method static synthetic access$1(Lorg/zeam/PagingView;)Landroid/widget/LinearLayout;
    .locals 1
    .parameter

    .prologue
    .line 16
    iget-object v0, p0, Lorg/zeam/PagingView;->mPageViewHolder:Landroid/widget/LinearLayout;

    return-object v0
.end method

.method static synthetic access$2(Lorg/zeam/PagingView;)I
    .locals 1
    .parameter

    .prologue
    .line 20
    iget v0, p0, Lorg/zeam/PagingView;->mCurrentPageIndex:I

    return v0
.end method

.method static synthetic access$3(Lorg/zeam/PagingView;I)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 20
    iput p1, p0, Lorg/zeam/PagingView;->mCurrentPageIndex:I

    return-void
.end method

.method static synthetic access$4(Lorg/zeam/PagingView;Landroid/view/MotionEvent;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 89
    iput-object p1, p0, Lorg/zeam/PagingView;->mCurrentMotionEvent:Landroid/view/MotionEvent;

    return-void
.end method

.method static synthetic access$5(Lorg/zeam/PagingView;)Landroid/view/GestureDetector;
    .locals 1
    .parameter

    .prologue
    .line 19
    iget-object v0, p0, Lorg/zeam/PagingView;->mGestureDetector:Landroid/view/GestureDetector;

    return-object v0
.end method

.method private init()V
    .locals 4

    .prologue
    const/4 v2, -0x1

    .line 41
    invoke-virtual {p0}, Lorg/zeam/PagingView;->getContext()Landroid/content/Context;

    move-result-object v0

    .line 42
    .local v0, context:Landroid/content/Context;
    new-instance v1, Landroid/widget/FrameLayout$LayoutParams;

    invoke-direct {v1, v2, v2}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V

    .line 44
    .local v1, layoutParams:Landroid/widget/FrameLayout$LayoutParams;
    new-instance v2, Landroid/widget/LinearLayout;

    invoke-direct {v2, v0}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    iput-object v2, p0, Lorg/zeam/PagingView;->mPageViewHolder:Landroid/widget/LinearLayout;

    .line 45
    iget-object v2, p0, Lorg/zeam/PagingView;->mPageViewHolder:Landroid/widget/LinearLayout;

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Landroid/widget/LinearLayout;->setOrientation(I)V

    .line 46
    iget-object v2, p0, Lorg/zeam/PagingView;->mPageViewHolder:Landroid/widget/LinearLayout;

    invoke-virtual {v2, v1}, Landroid/widget/LinearLayout;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 48
    iget-object v2, p0, Lorg/zeam/PagingView;->mPageViewHolder:Landroid/widget/LinearLayout;

    invoke-virtual {p0, v2}, Lorg/zeam/PagingView;->addView(Landroid/view/View;)V

    .line 49
    return-void
.end method

.method private onScrolling()V
    .locals 1

    .prologue
    .line 143
    iget-object v0, p0, Lorg/zeam/PagingView;->mOnPageScrollListener:Lorg/zeam/PagingView$OnPageScrollListener;

    if-eqz v0, :cond_0

    .line 144
    iget-object v0, p0, Lorg/zeam/PagingView;->mOnPageScrollListener:Lorg/zeam/PagingView$OnPageScrollListener;

    invoke-virtual {v0}, Lorg/zeam/PagingView$OnPageScrollListener;->onScroll()V

    .line 146
    :cond_0
    return-void
.end method


# virtual methods
.method protected clearPagingViews()V
    .locals 1

    .prologue
    .line 93
    iget-object v0, p0, Lorg/zeam/PagingView;->mPageViewHolder:Landroid/widget/LinearLayout;

    invoke-virtual {v0}, Landroid/widget/LinearLayout;->removeAllViewsInLayout()V

    .line 94
    iget-object v0, p0, Lorg/zeam/PagingView;->mPageViewHolder:Landroid/widget/LinearLayout;

    invoke-virtual {v0}, Landroid/widget/LinearLayout;->invalidate()V

    .line 95
    return-void
.end method

.method protected getCurrentPageIndex()I
    .locals 1

    .prologue
    .line 161
    iget v0, p0, Lorg/zeam/PagingView;->mCurrentPageIndex:I

    return v0
.end method

.method protected getPageCount()I
    .locals 1

    .prologue
    .line 157
    iget-object v0, p0, Lorg/zeam/PagingView;->mPageViewHolder:Landroid/widget/LinearLayout;

    invoke-virtual {v0}, Landroid/widget/LinearLayout;->getChildCount()I

    move-result v0

    return v0
.end method

.method protected onScrollChanged(IIII)V
    .locals 0
    .parameter "l"
    .parameter "t"
    .parameter "oldl"
    .parameter "oldt"

    .prologue
    .line 99
    invoke-super {p0, p1, p2, p3, p4}, Landroid/widget/HorizontalScrollView;->onScrollChanged(IIII)V

    .line 100
    invoke-direct {p0}, Lorg/zeam/PagingView;->onScrolling()V

    .line 101
    return-void
.end method

.method public onTrackballEvent(Landroid/view/MotionEvent;)Z
    .locals 1
    .parameter "motionEvent"

    .prologue
    .line 105
    const/4 v0, 0x1

    return v0
.end method

.method public resetScroll()V
    .locals 1

    .prologue
    const/4 v0, 0x0

    .line 153
    invoke-virtual {p0, v0, v0}, Lorg/zeam/PagingView;->scrollTo(II)V

    .line 154
    return-void
.end method

.method public setOnPageScrollListener(Lorg/zeam/PagingView$OnPageScrollListener;)V
    .locals 0
    .parameter "onPageScrollListener"

    .prologue
    .line 52
    iput-object p1, p0, Lorg/zeam/PagingView;->mOnPageScrollListener:Lorg/zeam/PagingView$OnPageScrollListener;

    .line 53
    return-void
.end method

.method protected setPagingViews(Ljava/util/ArrayList;)V
    .locals 6
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList",
            "<",
            "Landroid/view/View;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 57
    .local p1, items:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Landroid/view/View;>;"
    iget-object v1, p0, Lorg/zeam/PagingView;->mPageViewHolder:Landroid/widget/LinearLayout;

    .line 58
    .local v1, pageViewHolder:Landroid/widget/LinearLayout;
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    invoke-virtual {p1}, Ljava/util/ArrayList;->size()I

    move-result v3

    if-lt v0, v3, :cond_0

    .line 63
    new-instance v3, Lorg/zeam/PagingView$1;

    invoke-direct {v3, p0}, Lorg/zeam/PagingView$1;-><init>(Lorg/zeam/PagingView;)V

    invoke-virtual {p0, v3}, Lorg/zeam/PagingView;->setOnTouchListener(Landroid/view/View$OnTouchListener;)V

    .line 86
    new-instance v3, Landroid/view/GestureDetector;

    new-instance v4, Lorg/zeam/PagingView$PageViewGestureDetector;

    const/4 v5, 0x0

    invoke-direct {v4, p0, v5}, Lorg/zeam/PagingView$PageViewGestureDetector;-><init>(Lorg/zeam/PagingView;Lorg/zeam/PagingView$PageViewGestureDetector;)V

    invoke-direct {v3, v4}, Landroid/view/GestureDetector;-><init>(Landroid/view/GestureDetector$OnGestureListener;)V

    iput-object v3, p0, Lorg/zeam/PagingView;->mGestureDetector:Landroid/view/GestureDetector;

    .line 87
    return-void

    .line 59
    :cond_0
    invoke-virtual {p1, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/View;

    .line 60
    .local v2, view:Landroid/view/View;
    invoke-virtual {v1, v2}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    .line 58
    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method
